# coding=utf-8
__author__ = 'golsee'

from flask import Blueprint
from . import page, backup

admin = Blueprint('admin', __name__, template_folder='templates', url_prefix='/admin')

#: 注册路由
admin.add_url_rule('/article', view_func=page.article)
admin.add_url_rule('/', view_func=page.index)
admin.add_url_rule('/users', view_func=page.users)
admin.add_url_rule('/useredit/<id>', view_func=page.useredit, methods=['GET', 'POST'])
admin.add_url_rule('/userdelete/<id>', view_func=page.userdelete)
admin.add_url_rule('/category', view_func=page.category)
admin.add_url_rule('/categorycreate', view_func=page.categorycreate, methods=['GET', 'POST'])
admin.add_url_rule('/categoryedit/<id>', view_func=page.categoryedit, methods=['GET', 'POST'])
admin.add_url_rule('/categorydelete/<id>', view_func=page.categorydelete)
admin.add_url_rule('/articledelete/<id>', view_func=page.articledelete)
admin.add_url_rule('/admin_second_bar', view_func=page.admin_second_bar)
admin.add_url_rule('/admin_second_baredit/<id>', view_func=page.admin_second_baredit, methods=['GET', 'POST'])
admin.add_url_rule('/admin_second_baradd', view_func=page.admin_second_baradd, methods=['GET', 'POST'])
admin.add_url_rule('/settings', view_func=page.settings, methods=['GET', 'POST'])
admin.add_url_rule('/imgs', view_func=page.imgs)
admin.add_url_rule('/atts', view_func=page.atts)
admin.add_url_rule('/rmfile/<filename>/<urls>', view_func=page.rmfile)
admin.add_url_rule('/backup', view_func=backup.backup)
admin.add_url_rule('/dobackup', view_func=backup.dobackup)
admin.add_url_rule('/comment', view_func=page.comments)
admin.add_url_rule('/comment_pass/<int:id>', view_func=page.comment_pass)
admin.add_url_rule('/comment_disable/<int:id>', view_func=page.comment_disable)
